﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace MyFace
{
    static class Cursor
    {
        static public MouseState mstate;
        static public Rectangle RecMouse = new Rectangle(0, 0, 10, 10);
        static Texture2D TexMouse;
        static public MouseState mstateold;

        static public int X;
        static public int Y;

        static public void LoadContent(ContentManager Content)
        {
            TexMouse = Content.Load<Texture2D>("cursor");
        }
        static public void Update(GameTime gameTime)
        {
            mstate = Mouse.GetState();
            
            X = mstate.X;
            Y = mstate.Y;
            if (mstateold != mstate)
            {
                Console.WriteLine(X + ", " + Y + ": " + (mstate.LeftButton == ButtonState.Pressed) + "/" + (mstateold.LeftButton == ButtonState.Pressed));
            }
            //mstateold = mstate;

        }

        public static void UpdateOld()
        {
            mstateold = mstate;
        }


        static public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(TexMouse, new Vector2(X, Y), Color.White);
        }
    }
}
